package Vehicle;

public class Car extends Vehicle {

	//轿车特有的属性：型号
	private String model;
	
	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	//构造无参方法
	public Car() {

	}
	//构造有参方法
	public Car(String id, String brand, double perRent, String model) {
		super(id, brand, perRent);
		this.model = model;
	}
	
	@Override
	public double calcRent(int days) {
		//重写计算租赁费用的方法
		double rent=getPerRent()*days;//计算未打折的租赁费用
		if(days>7 && days<=30) {
			rent*=0.9;
		}else if(days>30 && days<=150){
			rent*=0.8;
		}else if(days>150) {
			rent*=0.7;
		}
		return rent;
	}
	
	//重写toString 方法
	@Override
	public String toString() {
		return super.toString()+"，型号是："+model;
	}


}
